<?php

	if ( !isset($module) ) {

		$module = '';

	}

	/*
	 * TODO : Fix this temporary access management code
	 */
	
	$curruser = $this->Session->read('User');
	
	$accountingModules = array("Journal", "Ledger", "Balance Sheet", "Profit and Loss");
	$administrationModules = array("Category", "Admin Home");
	
	$otherModules = array("Invoice", "Inventory", "Human Resources", "Commission", "Administration");
		
	echo "<li class='TopSection " . (in_array($module, $accountingModules) ? 'active' : '') . "'>Accounting</li>";
	echo "<li " . ($module == 'Journal' ? 'class=active' : '') . ">" . $this->Html->link('Journal', array('controller' => 'ledgers', 'action' => 'index')) . "</li>";
	
	if ($curruser['User']['id'] != 5 ) { // Remove this later on
		echo "<li class='TopSection " . (in_array($module, $otherModules) ? 'active' : '') . "'>Other Modules</li>";
		echo "<li " . ($module == 'Inventory' ? 'class=active' : '') . "><a href='inventory/inventory_list.php'>Inventory</a></li>";
		echo "<li " . ($module == 'Human Resources' ? 'class=active' : '') . "><a href='customer.php'>Human Resources</a></li>";
		echo "<li " . ($module == 'Commission' ? 'class=active' : '') . "><a href='comisionn.php'>Commission</a></li>";
		echo "<li " . (in_array($module, $administrationModules) ? 'class=active' : '') . ">" . $this->Html->link('Administration', array('controller' => 'home', 'action' => 'admin_home')) . "</li>";
		echo "<li " . ($module == 'Invoice' ? 'class=active' : '') . ">" . $this->Html->link('Invoice', array('controller' => 'invoice_headers', 'action' => 'index')) . "</li>";
		//echo "<li>" . $module . "</li>";
	}
	
	

?>